package  
{
	import flash.display.Sprite;
	/**
	 * ...
	 * @author patsup
	 * 
	 * 		The PirateLocation child class which holds PirateUnits (initially as well as
	 * 	while awaiting being moved to PiratePlank to be executed).
	 * 
	 **********	Potential issues:
	 * 		Initialize() calls all new data for each PirateUnit... hopefully garbage collection takes care of it!
	 * 
	 * *** public functions
	 * Initialize(numPirates:int):void
	 * NumPirates():int
	 * GetPirateValueAt(i:int):int
	 * 
	 */
	public class PirateLineup extends PirateLocation
	{
		private const PIRATE_SPACING:int = 50;
		
		public function PirateLineup(numPirates:int, xCoord:int, yCoord:int) 
		{
			x = xCoord;
			y = yCoord;
			
			Initialize(numPirates);
		}
		
		//Initialize()
		//Initializes the PirateLineup
		public function Initialize(numPirates:int):void
		{
			RemovePirates();
			for (var i:int = 0; i < numPirates; i++)
			{
				var _pirate:PirateUnit = new PirateUnit(this, i+1, PIRATE_SPACING * i, 0);
				pirates.push(_pirate);
				addChild(_pirate);
			}
			
		}
		
		//NumPirates()
		//Accessor function to return the number of pirates in its pirates vector
		public function NumPirates():int
		{
			return pirates.length;
		}
		
		//GetPirateValueAt()
		//Accessor function to return the number of pirates in its pirates vector
		public function GetPirateValueAt(i:int):int
		{
			return pirates[i].GetNumber();
		}
		
		
	}

}